<template>
	<view>
		<view>
			<u-navbar   :height="70"
			title="更多" :title-size="34" title-color="#000000"
			:background="{ background: '#ffffff'  }" 
			:border-bottom="false">
			</u-navbar>
		</view>
		<view style="background-color: #ffffff;">
			<u-cell-item :titleStyle="titleStyle" :border-top="true" title="加入黑名单"  :arrow="false" hover-class="none">
				<u-switch active-color="#19BE6B" inactive-color="#ededed" slot="right-icon" 
				v-model="blackStatus" 
				@change="changeBlackStatus"></u-switch>
			</u-cell-item>
			<u-cell-item :titleStyle="titleStyle"  title="举报"    hover-class="none" @click="showReport"></u-cell-item>
			<u-gap height="20" bg-color="#ededed" margin-top="0" margin-bottom="1"></u-gap>
			<u-cell-item :arrow="false"  :border-bottom="false" @click="deleteFriend">
				<view class="u-flex u-row-center u-col-center"
						style="font-size: 40rpx;color: #FB5151;text-align: center;">
					<view>
						<text>删除好友</text>
					</view>
				</view>
			</u-cell-item>
		</view>
		<u-modal v-model="reportShow" :mask-close-able="false"  width="70%" :show-title="false"
				show-cancel-button cancel-text="再想想" cancel-color="#888787"
				show-confirm-button	confirm-text="确定" confirm-color="#EA4335"
				@confirm="confrimReport()" @cancel="cancelReport()">
			<view style="color: #0F1317;font-weight: bold;text-align: center;padding-top: 50rpx;padding-bottom: 50rpx;">
				<text>确定要举报他吗?</text>
			</view>
		</u-modal>
		
		<u-modal v-model="deleteShow" :mask-close-able="false"  width="70%" :show-title="false"
				show-cancel-button cancel-text="再想想" cancel-color="#888787"
				show-confirm-button	confirm-text="确定" confirm-color="#EA4335"
				@confirm="confrimDelete()" @cancel="cancelDelete()">
			<view style="color: #0F1317;font-weight: bold;text-align: center;padding-top: 50rpx;padding-bottom:10rpx;">
				<text>确定要删除他吗？</text>
			</view>
			<view style="padding-bottom: 50rpx;padding-bottom: 50rpx;color: #A5A5A5;font-size: 30rpx;text-align: center;">
				<text>删除后所有聊天记录将丢失</text>
			</view>
		</u-modal>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				titleStyle: {
					marginLeft: '10rpx',
					color: '#000000',
					fontSize: "34rpx",
				},
				blackStatus:false,
				friendInfoObj:{},
				reportShow:false,
				deleteShow:false,
			};
		},
		onLoad:function(option){
			let  friendInfo= option.friendInfo;
			if(friendInfo!=null&&friendInfo.length>0){
				let objStr= decodeURIComponent(friendInfo);
				let  friendInfoObj= JSON.parse(objStr);
				console.log("好友信息",friendInfoObj);
				this.friendInfoObj=friendInfoObj;
			};
		},
		methods:{
			showReport(){
				this.reportShow=true;
			},
			confrimReport(){
				this.cancelReport();
			},
			cancelReport(){
				this.reportShow=false;
			},
			//黑名单
			changeBlackStatus(flag){
				let that=this;
				let blackStatus=0;
				if(flag==true){
					blackStatus=1;
				}else{
					blackStatus=0;
				}
			},
			deleteFriend(){
				this.deleteShow=true;
			},
			confrimDelete(){
				this.cancelDelete();
			},
			cancelDelete(){
				this.deleteShow=false;
			},
		}
	}
</script>

<style lang="scss">

</style>
<style>
	page{
		background-color: #EDEDED;
	}
</style>
